package com.asdc.autoscanfiles.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author zhangbingyue
 * @Description //TODO $
 * @Date $ $
 * @Param $
 * @return $
 **/
public class StaticUtils {
	
	//字典表类型含义
    public static final String type0="9";//省份
    public static final String type1="1";//区站号
    public static final String type2="2";//资料要素
    public static final String type3="3";//文件类型
	
	/* 分类文件夹规则 一级分类 */
	public static final String AGME = "AGME";// 农气

	public static final String RADI = "RADI";// 辐射

	public static final String SURF = "SURF";// 地面

	public static final String UPAR = "UPAR";// 报表

	public static final Map<String, String> level1Names = new HashMap<>();

	/* 二级分类 */
	public static final String ZJ = "ZJ"; // 自记纸
	public static final String QB = "QB"; // 高空报表
	public static final String WR = "WR"; // 气象报表(Weather report)
	public static final Map<String, String> level2Names = new HashMap<>();
	/* 三级分类 */
	public static final String WIND = "WIND"; /* 风 */
	public static final String WIN = "WIN"; /* 风 */
	public static final String PRE = "PRE"; /* 降水 */
	public static final String GB = "GB"; /* 高表 */
	public static final Map<String, String> level3Names = new HashMap<>();
	
	public static final String ELEMENT_R = "R";
	public static final String ELEMENT_F = "F";
	public static final String ELEMENT_U = "UPAR";
	public static final Map<String, String> elementsNames = new HashMap<>();

	static {
		level1Names.put(AGME, "农气");
		level1Names.put(RADI, "辐射");
		level1Names.put(SURF, "地面");
		level1Names.put(UPAR, "报表");

		level2Names.put(ZJ, "自记纸");
		level2Names.put(QB, "高空报表");
		level2Names.put(WR, "气象报表");

		level3Names.put(WIND, "风");
		level3Names.put(WIN, "风");
		level3Names.put(PRE, "降水");
		level3Names.put(GB, "高表");
		level3Names.put(QB, "气表");

		elementsNames.put(ELEMENT_R, "降水");
		elementsNames.put(ELEMENT_F, "风");
		elementsNames.put(ELEMENT_U, "报表");
	}

	public final static String getLevel1Name(String level1) {
		if (level1Names.containsKey(level1)) {
			return level1Names.get(level1);
		}
		return "";
	}

	public final static String getLevel2Name(String level2) {
		if (level2Names.containsKey(level2)) {
			return level2Names.get(level2);
		}
		return "";
	}

	public final static String getLevel3Name(String level3) {
		if (level3.startsWith("GB")){
			level3 = "GB";
		}else if (level3.startsWith("QB")){
			level3 = "QB";
		}
		if (level3Names.containsKey(level3)) {
			return level3Names.get(level3);
		}
		return "";
	}
	
	public final static String getElementName(String element) {
		if (elementsNames.containsKey(element)) {
			return elementsNames.get(element);
		}
		return "";
	}

}
